class Bullet extends egret.Sprite {
	private _speed: number = 1500;
	public _vector: egret.Point = null;

	public constructor() {
		super();

		var body = new egret.Bitmap(RES.getRes("bullet_95m_png"));
		this.addChild(body);
		this.anchorOffsetX = 33;
	}

	public onUpdate(span: number) {
		if (this._vector != null) {
			this.x += this._vector.x * this._speed * (span / 1000);
			this.y += this._vector.y * this._speed * (span / 1000);

			if (this.x > 640+10 || this.x < 0-10 || this.y > 960+10 || this.y < 0-10) {
				this.Destroy();
			}
		}
	}

	public Destroy(){
		this.parent.removeChild(this);
	}
}